package com.rambo.spm.common.controller;

/**
 * Ajax 请求时的自定义查询状态码，主要参考Http状态码，但并不完全对应
 */
public enum HttpCode {
    OK(200, "请求成功"),

    MULTI_STATUS(207, "频繁操作"),

    LOGIN_FAIL(303, "登录失败"),

    BAD_REQUEST(400, "请求参数出错 "),

    UNAUTHORIZED(401, "没有登录"),

    FORBIDDEN(403, "没有权限 "),

    NOT_FOUND(404, "找不到页面"),

    REQUEST_TIMEOUT(408, "请求超时"),

    CONFLICT(409, "发生冲突"),

    GONE(410, "已被删除"),

    LOCKED(423, "已被锁定"),

    INTERNAL_SERVER_ERROR(500, "服务器出错");

    private final Integer value;
    private final String msg;

    HttpCode(Integer value, String msg) {
        this.value = value;
        this.msg = msg;
    }

    public Integer getValue() {
        return value;
    }

    public String getMsg() {
        return msg;
    }

    public String toString() {
        return this.value.toString();
    }
}
